home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
276-300
/
299
/
rxil
/
src
/
delete_port.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-14
|
1KB
|
74 lines
/* delete_port.c */
/* Copyright © 1989 by Donald T. Meyer, Stormgate Software
* All Rights Reserved
*/
#include "rxil.h"
/* NAME
* RxilDeletePort
*
* SYNOPSIS
* RxilDeletePort( port );
*
* struct MsgPort *port;
*
* FUNCTION
* This will safely delete a message port used to receive commands
* from ARexx.
* This is acomplished by setting a failure return code and
* replying the message if it is from ARexx.
* If the message is not from ARexx, it is merely replied.
*
* WARNING: If the port was/is used to receive replys, there must
* be no chance of a reply being pending when this function is
* called!
*
* INPUTS
* port = pointer to a MsgPort. Normally one that was opened
* for receiving ARexx commands.
*
* RESULT
* None
*
* SIDES
*
* HISTORY
* 01-Aug-89 Creation.
*
* BUGS
*
* SEE ALSO
*
*/
void RxilDeletePort( struct MsgPort *port )
{
struct RexxMsg *rexxmsg;
Forbid();
while( rexxmsg = (struct RexxMsg *)GetMsg( port ) )
{
if( IsRexxMsg( rexxmsg ) )
{
/* Set failure code */
rexxmsg->rm_Result1 = RC_FATAL;
rexxmsg->rm_Result2 = 0;
}
ReplyMsg( (struct Message *)rexxmsg );
}
DeletePort( port );
Permit();
}